package com.waverider.promotion.biz.manager;

import com.waverider.promotion.domain.OrderDO;
import com.waverider.promotion.model.OrderQueryModel;
import com.waverider.promotion.model.ResultModel;

/**
 * 
 * @author sihai
 *
 */
public interface OrderManager
{
	/**
	 * 
	 * @param order
	 */
	void add(OrderDO order);
	
	/**
	 * 通过orderId查询是否存在
	 * @param order
	 */
	void addOrUpdateOrder(OrderDO order);
	
	/**
	 * 
	 * @param buyer
	 * @param itemId
	 * @return
	 */
	OrderDO getByBuyerAndItemId(Long buyer, Long itemId);
	
	/**
	 * 
	 * @param orderId
	 * @return
	 */
	OrderDO getOrderByOrderId(Long orderId);
	
	/**
	 * 
	 * @param queryModel
	 * @return
	 */
	ResultModel<OrderDO> getOrderList(OrderQueryModel queryModel);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	boolean update(OrderDO order);
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	boolean delete(Long id);
	
	/**
	 * 
	 * @param sellerId
	 * @param tradeId
	 */
	void syncTrade(Long sellerId, Long tradeId);
}
